package com.sky.controller.admin;

import com.sky.dto.OrdersSubmitDTO;
import com.sky.dto.OrdersUpStatusDTO;
import com.sky.result.Result;
import com.sky.service.OrderService;
import com.sky.vo.OrderSubmitVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "订单管理")
@RequestMapping("/admin/order")
@RestController("adminDishController")
public class OrderController {
    @Autowired
    OrderService orderService;

    /**
     * 完成订单接口
     */
    @ApiOperation("/完成订单")
    @PutMapping("/complete/{id}")
    public Result<Void> orderOK(@PathVariable Long id) {
        orderService.orderOK(id);
        return Result.success();
    }

    /**
     * 取消订单接口
     */
    @ApiOperation("/取消订单")
    @PutMapping("/cancel")
    public Result<Void> ordersNO(@RequestBody OrdersUpStatusDTO dto) {
        orderService.orderNO(dto);
        return Result.success();
    }
}